package cn.fage.filters;

import javax.servlet.*;
import java.io.IOException;

/**
 * @author lin
 * @version 1.0
 * @date 2020-07-29 11:32
 * @Description TODO
 */

public class TestFilter implements Filter {
    //初始化配置参数，在doFilter()方法之前被调用
    @Override
    public void init(FilterConfig config) throws ServletException {

    }


    //该方法在客户端请求及服务器端回复时都将被自动调用
    @Override
    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain)
            throws ServletException, IOException {
        System.out.println(" 进入到 TestFilter ");
        chain.doFilter(req, resp);
    }


    //结束过滤器，doFilter()方法完成后被调用
    @Override
    public void destroy() {
    }
}
